#ifndef __MCGRIPPOINT_H_
#define __MCGRIPPOINT_H_

#include <IGripPoint.h>
#include <MCGraphicsItem.h>
#include <CGSolverObject.h>

class MCGripPoint : public MCGraphicsItem, public IGripPoint
{
public:

    MCGripPoint(MCGraphicsItem *owner, MCGripPointType type, size_t index, const MCPoint2D &position);

    void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr) override;
    QPainterPath shape() const override;

    size_t index() const override;
    IGraphicsItem *owner() override;
    const MCPoint2D &position() override;
    void move(const MCVector2 &direction) override;
    void setPositionAt(const MCPoint2D &at) override;
    void update(const MCPoint2D &position) override;
    void update(double x, double y) override;
    ICanvas *canvas() override;

private:

    MCGraphicsItem *_owner;
    MCPoint2D _position;
    size_t _index;
    MCGripPointType _type;

};

#endif // !__MCGRIPPOINT_H_
